<template>
  <div class="wp">
    <div class="hdr">
    <img src="@/assets/2_25.png" class="pic_1" @click="back"/>
    <h3 class="hdr-cfn-tit">分类</h3>
    <img src="@/assets/2_3.png" class="pic_3" />
    <van-search
        v-model="value"
        shape="round"
        background="#21272e"
        placeholder="搜索.."
        left-icon="none"
        @click="btn"
      />  
    </div>
    <div class="hdr-two"></div>
    <div class="cfh-sch">
        <van-tabs v-model="active">
        <van-tab v-for="(item, index) in classes" :key="index" >
          <template #title>
            <h4 class="text">{{ item.text }}</h4>
          </template>
        <div class="hot-sea">
        <h3>新上架 <img src="@/assets/2_jt.png" /> <span>查看全部</span></h3>
        <ul class="ul-sea">
        <li>
          <img src="@/assets/2_12.png" class="pic-sea-1">
            <h4 class="txt-sea">三体：死神永生</h4>
            <h5 class="name-sea">刘慈心</h5>
        </li>
         <li>
          <img src="@/assets/2_13.png" class="pic-sea-1">
            <h4 class="txt-sea">人类简史</h4>
            <h5 class="name-sea">尤瓦尔• 郝拉利</h5>
        </li>
         <li>
          <img src="@/assets/2_14.png" class="pic-sea-1">
            <h4 class="txt-sea">徐三观卖血记</h4>
            <h5 class="name-sea">余华</h5>
        </li>
      </ul>
      </div>
      <div class="hot-sea tow-cfn">
        <h3>热门<img src="@/assets/2_jt.png" /> <span>查看全部</span></h3>
        <ul class="ul-sea">
        <li>
          <img src="@/assets/2_12.png" class="pic-sea-1">
            <h4 class="txt-sea">三体：死神永生</h4>
            <h5 class="name-sea">刘慈心</h5>
        </li>
         <li>
          <img src="@/assets/2_13.png" class="pic-sea-1">
            <h4 class="txt-sea">人类简史</h4>
            <h5 class="name-sea">尤瓦尔• 郝拉利</h5>
        </li>
         <li>
          <img src="@/assets/2_14.png" class="pic-sea-1">
            <h4 class="txt-sea">徐三观卖血记</h4>
            <h5 class="name-sea">余华</h5>
        </li>
      </ul>
      </div>
        </van-tab>
      </van-tabs>
    </div>
  </div>
</template>

<script>
export default {
  // 定义属性
  data() {
    return {
      classes :[
          {
            id:1,
            text:'科幻',
         },
         {
            id:2,
            text:'职场',
         },
         {
            id:3,
            text:'艺术',
         },
         {
            id:4,
            text:'言情',
         },
         {
            id:5,
            text:'军事',
         },
         {
            id:6,
            text:'科学',
         }
      ]
    }
  },
  // 计算属性，会监听依赖属性值随之变化
  computed: {
  },
  // 监控data中的数据变化
  watch: {},
  // 方法集合
  methods: {
      back(){
        this.$router.go(-1);//返回上一层
    },
        btn () {
      this.$router.push('/search')
    }
  },
  // 生命周期 - 创建完成（可以访问当前this实例）
  created() {
    
  },
  // 生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {
    
  }
} 
</script>

<style lang='less'>
.hdr{
  width: 100%;
  height: 400px;
  position: fixed;
  top: 0;
  left: 0;
  background-color: #21272e;
  z-index: 999;
    .pic_1 {
    width: 34px;
    height: 33px;
    margin-top: 112px;
    margin-left: 48px;
  }
    .pic_3 {
    width: 40px;
    position: absolute;
    top: 235px;
    left: 82px;
  }
  .hdr-cfn-tit{
    position: absolute;
    left: 50%;
    top: 95px;
    transform: translate(-50%);
    font-size: 44px;
	font-weight: normal;
    font-stretch: normal;
    letter-spacing: 0px;
    color: #ffffff;
  }
  }
  .hdr-two{
    height:360px 
  }
  .van-search {
  margin-top: 15px;
  padding: 24px 50px;
  color: #9da3b4;
  padding-bottom: 0;
}
.van-search__content--round {
  background-color: #2d353d;
}
.van-field__body {
  font-size: 34px;
  height: 90px;
}
.van-field__control[type="search"] {
  padding-left: 55px;
  color: #9da3b4;
}
.cfh-sch{
.van-tabs__wrap--scrollable .van-tabs__nav{
    background-color: #21272e;
}
.van-tabs--line .van-tabs__wrap{
    margin-top: 30px;
    padding-left: 30px;
    border-bottom: 2px solid #2d353d;
}
.van-tabs__line{
    width: 130px;
    margin-bottom: -5px;
    background-color: #fb6894;
}
.van-tab__text{
    font-size: 32px;
}
.van-tabs__wrap--scrollable .van-tab{
    width: 130px;
}
.van-tab--active{
    color: #ffffff;
}
.tow-cfn{
    margin-top: 50px;
}
.hot-sea{
   overflow: hidden;
  margin-left: 50px;
    h3 {
    margin-top: 40px;
    font-size: 36px;
    font-weight: normal;
    color: #ffffff;
    span {
      float: right;
      margin-top: 3px;
      margin-right: 10px;
      font-size: 26px;
      color: #a2a8ba;
    }
    img {
      float: right;
      width: 10px;
      margin-top: 12px;
      margin-right: 50px;
    }
    }
    .ul-sea{
      overflow: hidden;
      padding-bottom: 30px;
      border-bottom: solid 1px #2a2c33;
      li{
        float: left;
        margin-top: 40px;
        padding-right: 35px;
      }
      .pic-sea-1{
       width: 192px;
      }
      .txt-sea{
        padding-top: 10px;
        font-size: 28px;
	      font-weight: normal;
	      font-stretch: normal;
	      color: #ffffff;
      }
      .name-sea{
        padding-top: 10px;
        font-size: 24px;
	      font-weight: normal;
       	font-stretch: normal;
	      letter-spacing: 0px;
       	color: #5d637c;
      }
    }
}
}

</style>